package modelo;

import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Conexion {
 static String DireccionBD="jdbc:firebirdsql://127.0.0.1:3050///var/lib/firebird/2.5/prod_mayo.fdb"; 
    
    
    static String Usuario="sysdba";
    static String Contrasena="masterkey";
    
    static String NombreDriver="org.firebirdsql.jdbc.FBDriver";
    
    public static Connection con;


	public Conexion() {
     try {
         Class.forName(NombreDriver) ;
         try {
             con = DriverManager.getConnection(DireccionBD, Usuario, Contrasena);
          //.........................................
         } catch (SQLException ex) {
             Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
         }
     } catch (ClassNotFoundException ex) {
         Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
     }
           

	}
	
	public Connection getConexion(){
		return con;
	}
	
	public void cerrarConexion(){
		try {
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
